{$contentClass}
  code
    padding 0.25rem 0.5rem
    margin 0
    font-size 0.85em
    background-color var(--background-subdued)
    border-radius 3px
    .token
      &.deleted
        color var(--danger)
      &.inserted
        color var(--primary)

{$contentClass}
  pre, pre[class*="language-"]
    line-height 1.4
    padding 1.25rem 1.5rem
    margin 0.85rem 0
    background-color var(--background-normal)
    border-radius 6px
    overflow auto
    code
      color var(--foreground-normal-alt)
      padding 0
      background-color transparent
      border-radius 0
	pre[class*="language-"]
		border 2px solid var(--border-subdued)
		max-width 100%
		overflow-x auto

div[class*="language-"]
  position relative
  background-color var(--background-subdued)
  border-radius 6px
  .highlight-lines
    user-select none
    padding-top 1.3rem
    position absolute
    top 0
    left 0
    width 100%
    line-height 1.4
    .highlighted
      background-color rgba(0, 0, 0, 66%)
  pre, pre[class*="language-"]
    background transparent
    position relative
    z-index 1
  &::before
    position absolute
    z-index 3
    top 0.8em
    right 1em
    font-size 0.75rem
    color rgba(255, 255, 255, 0.4)
  &:not(.line-numbers-mode)
    .line-numbers-wrapper
      display none
  &.line-numbers-mode
    .highlight-lines .highlighted
        position relative
        &:before
          content ' '
          position absolute
          z-index 3
          left 0
          top 0
          display block
          width $lineNumbersWrapperWidth
          height 100%
          background-color rgba(0, 0, 0, 66%)
    pre
      padding-left $lineNumbersWrapperWidth + 1 rem
      vertical-align middle
    .line-numbers-wrapper
      position absolute
      top 0
      width $lineNumbersWrapperWidth
      text-align center
      color rgba(255, 255, 255, 0.3)
      padding 1.25rem 0
      line-height 1.4
      br
        user-select none
      .line-number
        position relative
        z-index 4
        user-select none
        font-size 0.85em
    &::after
      content ''
      position absolute
      z-index 2
      top 0
      left 0
      width $lineNumbersWrapperWidth
      height 100%
      border-radius 6px 0 0 6px
      border-right 1px solid rgba(0, 0, 0, 66%)
      background-color var(--background-normal)


for lang in $codeLang
  div{'[class~="language-' + lang + '"]'}
    &:before
      content ('' + lang)

div[class~="language-javascript"]
  &:before
    content "js"

div[class~="language-typescript"]
  &:before
    content "ts"

div[class~="language-markup"]
  &:before
    content "html"

div[class~="language-markdown"]
  &:before
    content "md"

div[class~="language-json"]:before
  content "json"

div[class~="language-ruby"]:before
  content "rb"

div[class~="language-python"]:before
  content "py"

div[class~="language-bash"]:before
  content "sh"

div[class~="language-php"]:before
  content "php"

/** CUSTOM PRISM THEME **/

/**
 * prism.js tomorrow night eighties for JavaScript, CoffeeScript, CSS and HTML
 * Based on https://github.com/chriskempson/tomorrow-theme
 * @author Rose Pritchard
 */

code[class*="language-"],
pre[class*="language-"] {
	color: var(--foreground-subdued);
	background: none;
	font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
	font-size: 1em;
	text-align: left;
	white-space: pre;
	word-spacing: normal;
	word-break: normal;
	word-wrap: normal;
	line-height: 1.5;

	-moz-tab-size: 4;
	-o-tab-size: 4;
	tab-size: 4;

	-webkit-hyphens: none;
	-moz-hyphens: none;
	-ms-hyphens: none;
	hyphens: none;
}

/* Code blocks */
pre[class*="language-"] {
	padding: 1em;
	margin: .5em 0;
	overflow: auto;
}

:not(pre) > code[class*="language-"],
pre[class*="language-"] {
	background: var(--foreground-normal-alt);
}

/* Inline code */
:not(pre) > code[class*="language-"] {
	padding: .1em;
	border-radius: .3em;
	white-space: normal;
}

.token.comment,
.token.block-comment,
.token.prolog,
.token.doctype,
.token.cdata {
	color: var(--foreground-subdued);
}

.token.punctuation {
	color: var(--foreground-subdued);
}

.token.tag,
.token.attr-name,
.token.namespace,
.token.deleted {
	color: var(--danger);
}

.token.function-name {
	color: var(--warning);
}

.token.boolean,
.token.number,
.token.function {
	color: var(--danger);
}

.token.property,
.token.class-name,
.token.constant,
.token.symbol {
	color: var(--secondary-dark);
}

.token.selector,
.token.important,
.token.atrule,
.token.keyword,
.token.builtin {
	color: var(--secondary-dark);
}

.token.string,
.token.char,
.token.attr-value,
.token.regex,
.token.variable {
	color: var(--primary-dark);
}

.token.operator,
.token.entity,
.token.url {
	color: var(--secondary-dark);
}

.token.important,
.token.bold {
	font-weight: bold;
}
.token.italic {
	font-style: italic;
}

.token.entity {
	cursor: help;
}

.token.inserted {
	color: green;
}

@media (prefers-color-scheme: dark)
  {$contentClass}
    pre[class*="language-"]
      border 2px solid var(--border-normal) !important
